-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exploit new support in firefly-signer
and firefly-common
for large & scientific JSON numbers
#153
Conversation
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
9ca83c2
to
20dfcbb
Compare
Signed-off-by: Matthew Whitehead <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@@ -95,7 +95,7 @@ func (c *ethConnector) prepareDeployData(ctx context.Context, req *ffcapi.Contra | |||
ethParams := make([]interface{}, len(req.Params)) | |||
for i, p := range req.Params { | |||
if p != nil { | |||
err := json.Unmarshal([]byte(*p), ðParams[i]) | |||
err := p.Unmarshal(ctx, ðParams[i]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context: The type of p
is *fftypes.JSONAny
which has implemented an Unmarshal method
@@ -39,19 +40,91 @@ const samplePrepareDeployTX = `{ | |||
"gas": 1000000, | |||
"nonce": "111", | |||
"value": "12345678901234567890123456789", | |||
"contract": "0xfeedbeef", | |||
"contract": "0xdeadbeef", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah a slightly cheeky way to ensure the asserts in the tests don't match on the contract bytes when checking for integers that match 0xdeadbeef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait don't we have to fix the invoke contract as well?
You need the same fix in
|
Could it also affect the gas price
|
Signed-off-by: Matthew Whitehead <[email protected]>
Good spot, will address that now |
I think this case is OK as we're specifically unmarshaling to a |
Signed-off-by: Matthew Whitehead <[email protected]>
@EnriqueL8 new commits added to handle the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Not sure why codecov is not enabled here... |
Okay I've enabled CodeCov on this repo |
Re-Running Jobs to upload coverage |
This PR does 2 things:
firefly-common
(see especially PR Add support for 256 bit JSON numbers (vs. strings) firefly-common#147)firefly-signer
(see especially PR Add support for 256 bit JSON numbers (vs. strings), including scientific notation firefly-signer#76)firefly-transaction-manager
(see especially PR Update to the latest release of firefly-common firefly-transaction-manager#128)